 <?php
  require("conf/configuration.php");
    
  class RssFeed {
    
    private $title;
    private $url;
    private $xml;
    
    public function RssFeed($title, $url) {
      $this->title = $title;
      $this->url = $url;
      $this->xml = new SimpleXMLElement(file_get_contents($url));
    }
    
    public function getTitle() {
      return $this->title;
    }
    
    public function getURL() {
      return $this->url;
    }
    
    public function getItems() {
      $torrents = array();   
      foreach($this->xml->channel->item as $item)
        $torrents[] = new RssItem($item->title, $item->link);
      return $torrents;
    }
    
    public function printFeed() {
      print_r($this->xml);
    }
    
  }
  
 ?>